//
// Created by bleedingfight on 2020/7/5.
//
#include "isAnagram.h"
std::map<char,int> char_frequency(const std::string& s){
    std::map<char,int>frequency;
    for(auto ch:s){
        if(frequency.count(ch))
            frequency[ch]+=1;
        else
            frequency[ch]=1;
    }
    return frequency;
}
bool isAnagram(std::string s, std::string t){
    std::map<char,int>map_s = char_frequency(s);
    std::map<char,int>map_t = char_frequency(t);
    return map_s==map_t;
}
